﻿using B.S.DataBase.MyProject.ErrorCode;
using B.S.DataBase.MyWrite.API.Appicant.Command.RoleMenuCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.DataBase.MyWrite.API.Controllers
{
    /// <summary>
    /// 角色菜单关系管理
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class RoleMenuController : ControllerBase
    {
        private readonly IMediator mediator;

        public RoleMenuController(IMediator mediator)
        {
            this.mediator = mediator;
        }



        /// <summary>
        /// 添加角色菜单表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<string>> AddRoleMenu(AddRoleMenuCommand request)
        {
            return await mediator.Send(request);
        }

    }
}
